/****** Object: View [dbo].[vw_4_1]   Script Date: 2014-01-19 21:45:01 ******/
USE [SHMIS];
GO
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[vw_4_1]'))
BEGIN
DROP VIEW [dbo].[vw_4_1];
END
GO

SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE VIEW dbo.vw_4_1
AS
   SELECT Customer_Code,
          Contract_Num,
          Serial_Num,
          Customer_Simple_Code,
          Customer_Simple_Name,
          Date,
          Amount,
          Amount_Type,
          Duration_Begin,
          Duration_End,
          Adjust_Serial_Num,
          Depart_Id,
          cre_user,
          cre_date,
          chg_user,
          chg_date,
          verified,
          verify_user,
          deleted,
          audited,
          audit_user,
          Verify_Serial_Num,
          CASE isnull (Adjust_Serial_Num, '')
             WHEN '' THEN Serial_Num
             ELSE Adjust_Serial_Num
          END
             AS Order_Serial_Num
     FROM dbo.HD_AccountReceivable
    /*WHERE verified = '1' AND deleted = '0' AND audited = '1'*/
GO

